package com.dykj.fireFighting.web.devhis;

import com.dykj.fireFighting.api.elasticsearch.devHisSomke.entity.EsDevHisSomke;
import com.dykj.fireFighting.api.elasticsearch.devHisSomke.service.EsDevHisSomkeService;
import com.dykj.fireFighting.api.elasticsearch.devHisZc.entity.EsDevHisZc;
import com.dykj.fireFighting.api.socialUnit.devHis.dto.DevHisElectricalDto;
import com.dykj.fireFighting.common.core.annotation.AutoLog;
import com.dykj.fireFighting.common.core.api.CommonResult;
import com.dykj.fireFighting.common.core.vo.PageVo;
import com.dykj.fireFighting.web.base.shiro.ShiroUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Api(value = "海曼烟感设备运行记录接口", tags = {"海曼烟感设备运行记录接口"})
@RestController
@RequestMapping("devHis/devHisSmoke")
public class DevHisSmokeController {
    @DubboReference
    private EsDevHisSomkeService esDevHisSomkeService;


    /**
     * 海曼烟感运行记录列表
     *
     * @return
     */
    @AutoLog(value = "海曼烟感运行记录-分页列表查询")
    @ApiOperation(value = "海曼烟感运行记录分页列表", notes = "海曼烟感运行记录分页列表")
    @GetMapping("/list")
    public CommonResult<PageVo<EsDevHisSomke>> treeGrid(DevHisElectricalDto devHisElectricalDto) {
        Long enterpriseId = ShiroUtil.getUser().getEnterpriseId();
        devHisElectricalDto.setUnitId(enterpriseId+"");
        PageVo<EsDevHisSomke> page = esDevHisSomkeService.searchByCenterId("",enterpriseId + "", devHisElectricalDto.getName(),(int) devHisElectricalDto.getPage(), (int) devHisElectricalDto.getLimit(),
                devHisElectricalDto.getBeginDate(),devHisElectricalDto.getEndDate());
        return CommonResult.success(page);
    }
}
